<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp"%>
<!DOCTYPE html>
<html>
<head>
	<title><spring:message code="message.jieSuan.dingShiRenWu"/></title>
	<%@ include file="/WEB-INF/component/commonCSS.jsp"%>
    <!--[if lt IE 9]>
        <script src="lib/js/html5shiv.min.js"></script>
        <script src="lib/js/respond.min.js"></script>
    <![endif]-->
    <style type="text/css">
        div.list label {
            width: 60px;
        }
        div.list label * {
            vertical-align: middle;
            margin: 0px;
            padding: 0px;
        }
    </style>
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
    <section class="content-header">
        <h1><spring:message code="message.jieSuan.jieSuanSheZhi"/> </h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i><spring:message code="message.lable.first"/></a></li>
            <li><a href="#"><spring:message code="message.jieSuan.jieSuanSheZhi"/></a></li>
            <li><a href="#"><spring:message code="message.jieSuan.jieSuanSheZhi"/></a></li>
        </ol>
    </section>

        <section class="content">
       
	<form id="form" class="form-horizontal" action="${ctx }/settleconfig/saveSettleconfig.html" method="post">
	    <div class="box box-success" >
            <div class="box-header with-border">
                <h3 class="box-title"><spring:message code="message.jieSuan.dingShiRiQi"/></h3>
                <div class="box-tools pull-right">
                    <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
                </div>
            </div>
            
            <div style="position:absolute;bottom:46px;right:1px;"><img src='${ctx}/lib/img/settime.png'>	</div>
            <div style="margin-left:30px;">
            <div class="form-group form-group-xs configDiv">
            	<!-- <div>
                	<label for="name" class="col-sm-2 text-right">定时日期：&nbsp;&nbsp;</label>
                </div> -->
                <div class="col-sm-8 text-left">
                    <div class="form-group list" style="padding-left:50px;padding-top:10px">
                        <label><input type="checkbox" id="checkbox1"  name="usertype" value="1" /> 01<spring:message code="message.jieSuan.hao"/></label>
                        <label><input type="checkbox" id="checkbox2"  name="usertype" value="2" /> 02<spring:message code="message.jieSuan.hao"/></label>
                        <label><input type="checkbox" id="checkbox3"  name="usertype" value="3" /> 03<spring:message code="message.jieSuan.hao"/></label>
                        <label><input type="checkbox" id="checkbox4"  name="usertype" value="4" /> 04<spring:message code="message.jieSuan.hao"/></label>
                        <label><input type="checkbox" id="checkbox5"  name="usertype" value="5" /> 05<spring:message code="message.jieSuan.hao"/></label>
                        <label><input type="checkbox" id="checkbox6"  name="usertype" value="6" /> 06<spring:message code="message.jieSuan.hao"/></label>
                        <label><input type="checkbox" id="checkbox7"  name="usertype" value="7" /> 07<spring:message code="message.jieSuan.hao"/></label><br>
                        <label><input type="checkbox" id="checkbox8"  name="usertype" value="8" /> 08<spring:message code="message.jieSuan.hao"/></label>
                        <label><input type="checkbox" id="checkbox9"  name="usertype" value="9" /> 09<spring:message code="message.jieSuan.hao"/></label>
                        <label><input type="checkbox" id="checkbox10" name="usertype" value="10" /> 10<spring:message code="message.jieSuan.hao"/></label>
                        <label><input type="checkbox" id="checkbox11" name="usertype" value="11" /> 11<spring:message code="message.jieSuan.hao"/></label>
                        <label><input type="checkbox" id="checkbox12" name="usertype" value="12" /> 12<spring:message code="message.jieSuan.hao"/></label>
                        <label><input type="checkbox" id="checkbox13" name="usertype" value="13" /> 13<spring:message code="message.jieSuan.hao"/></label>
                        <label><input type="checkbox" id="checkbox14" name="usertype" value="14" /> 14<spring:message code="message.jieSuan.hao"/></label><br>
                        <label><input type="checkbox" id="checkbox15" name="usertype" value="15" /> 15<spring:message code="message.jieSuan.hao"/></label>
                        <label><input type="checkbox" id="checkbox16" name="usertype" value="16" /> 16<spring:message code="message.jieSuan.hao"/></label>
                        <label><input type="checkbox" id="checkbox17" name="usertype" value="17" /> 17<spring:message code="message.jieSuan.hao"/></label>
                        <label><input type="checkbox" id="checkbox18" name="usertype" value="18" /> 18<spring:message code="message.jieSuan.hao"/></label>
                        <label><input type="checkbox" id="checkbox19" name="usertype" value="19" /> 19<spring:message code="message.jieSuan.hao"/></label>
                        <label><input type="checkbox" id="checkbox20" name="usertype" value="20" /> 20<spring:message code="message.jieSuan.hao"/></label>
                        <label><input type="checkbox" id="checkbox21" name="usertype" value="21" /> 21<spring:message code="message.jieSuan.hao"/></label><br>
                        <label><input type="checkbox" id="checkbox22" name="usertype" value="22" /> 22<spring:message code="message.jieSuan.hao"/></label>
                        <label><input type="checkbox" id="checkbox23" name="usertype" value="23" /> 23<spring:message code="message.jieSuan.hao"/></label>
                        <label><input type="checkbox" id="checkbox24" name="usertype" value="24" /> 24<spring:message code="message.jieSuan.hao"/></label>
                        <label><input type="checkbox" id="checkbox25" name="usertype" value="25" /> 25<spring:message code="message.jieSuan.hao"/></label>
                        <label><input type="checkbox" id="checkbox26" name="usertype" value="26" /> 26<spring:message code="message.jieSuan.hao"/></label>
                        <label><input type="checkbox" id="checkbox27" name="usertype" value="27" /> 27<spring:message code="message.jieSuan.hao"/></label>
                        <label><input type="checkbox" id="checkbox28" name="usertype" value="28" /> 28<spring:message code="message.jieSuan.hao"/></label><br>
                        <label><input type="checkbox" id="checkbox29" name="usertype" value="29" /> 29<spring:message code="message.jieSuan.hao"/></label>
                        <label><input type="checkbox" id="checkbox30" name="usertype" value="30" /> 30<spring:message code="message.jieSuan.hao"/></label>
                        <label><input type="checkbox" id="checkbox31" name="usertype" value="31" /> 31<spring:message code="message.jieSuan.hao"/></label> 
                    </div>
                    <div class="form-group form-group-xs" style="margin-left:35px;margin-bottom:-5px;">
                    <label style="color:#FF0000"><spring:message code="message.jieSuan.jieSuanSheZhiZhuYi"/>                    	
                     </label>
                    </div>
                     
                    
                </div>

            </div>
          </div>  
          <div class="box-footer text-center">         
	    	         <button type="button" class="btn btn-success btn-sm" onclick="saveConfig();"><spring:message code="message.button.saveSpacing"/></button>
	    	         </div> 
        </div>
        
		<!-- <div class=" box box-warning bottongroup">
	    	<button type="button" class="btn btn-success btn-sm" onclick="saveConfig();">保  存</button>
	    </div>  -->
	</form>
     
    </section>
    <%@ include file="/WEB-INF/component/commonJS.jsp"%>
    <script type="text/javascript">
    $(function(){
		$("#checkbox31").change(
			function(){
			if($("#checkbox31").prop("checked")){
				$.HN.message.alert("<spring:message code="message.jieSuan.selectSanShiYiHao"/>", "<spring:message code="message.jieSuan.jingGao"/>", "");
			}
		})

		$("#checkbox30").change(
			function(){
			if($("#checkbox30").prop("checked")){
				$.HN.message.alert("<spring:message code="message.jieSuan.selectSanShiHao"/>", "<spring:message code="message.jieSuan.jingGao"/>", "");
			}
		})

        $("#checkbox29").change(
			function(){
			if($("#checkbox29").prop("checked")){
				$.HN.message.alert("<spring:message code="message.jieSuan.selectErShiJiuHao"/>", "<spring:message code="message.jieSuan.jingGao"/>", "");
			}
		})
    	var days = "${days}";
    	var daysArray= new Array()
    	daysArray = days.split(",");
    	for(var i = 0 ; i < daysArray.length; i++){
    		checkBoxId = "checkbox" + daysArray[i];
    		$("#"+checkBoxId+"").attr("checked", 'true');
    	}
    	
    })
    function saveConfig(){ //jquery获取复选框值 
    	$.HN.message.confirm('<spring:message code="message.HN.alert.OkSaveYESorNO"/>', '', '').on(function (e) {
            if (e) {
    	var configValue =''; 
    	$('input[name="usertype"]:checked').each(function(){ 
    		configValue = configValue + $(this).val()+","; //去除字符串用','分割
    	}); 
    	if (configValue.length==0){    //判断是否选取日期
    		$.HN.message.alert("<spring:message code="message.jieSuan.pleaseSelectDate"/>", "<spring:message code="message.HN.alert.type"/>", "success");
    		return ;
    	}
    	configValue = configValue.substring(0,configValue.length-1);//截取到最后一个','前
    	 $.post("${ctx }/settleconfig/saveSettleconfig.html", {
    		 "configValue" : configValue  //传截取的字符串到Controller
        }, function(result) {
        	var result  = eval("("+result+")");  //对字符串后返回result
      	  if (result.success) {
              $.HN.message.alert("<spring:message code="message.HN.alert.success"/>", "<spring:message code="message.HN.alert.type"/>", "success");
          } else {
              $.HN.message.alert("result.msg", "<spring:message code="message.HN.alert.type"/>", "error");
          }
      	}); 
            }
    	});
    	
      } 

    
	 
    
    
    </script>
</body>
</html>
